using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using MacomberMap.Common.Components;
using MacomberMap.Common.User_Interfaces.Components;
using MacomberMap.Common.Database_Interface;
using System.Xml;

namespace MacomberMap.Common.User_Interfaces.One_Lines.Elements
{
    /// <summary>
    /// This class holds information on the end cap element
    /// </summary>
    public class MM_OneLine_EndCap : MM_OneLine_Element
    {
        #region Initialization
        /// <summary>
        /// Initialize a new static var compensator
        /// </summary>
        /// <param name="DisplayParams"></param>
        public MM_OneLine_EndCap(MM_OneLine_Display DisplayParams)
            : base(DisplayParams)
        {
        }

        /// <summary>
        /// Initialize a new static var compensator
        /// </summary>
        /// <param name="BaseElement"></param>
        /// <param name="DisplayParams"></param>
        /// <param name="Orientation"></param>
        public MM_OneLine_EndCap(MM_Element BaseElement, MM_OneLine_Display DisplayParams, MM_OneLine_Element.enumOrientations Orientation)
            : base(BaseElement, DisplayParams, Orientation)
        {
        }

        /// <summary>
        /// Initialize a new static var compensator
        /// </summary>
        /// <param name="BaseElement"></param>
        /// <param name="DisplayParams"></param>
        /// <param name="DbConnection">The database connection</param>
        public MM_OneLine_EndCap(XmlElement BaseElement, MM_OneLine_Display DisplayParams, MM_Database DbConnection)
            : base(BaseElement, DisplayParams, DbConnection)
        {
        }
        #endregion

        #region Rendering
        /// <summary>
        /// Draw the image for the end cap
        /// </summary>
        /// <param name="g"></param>
        public override void DrawImage(Graphics g)
        {
            using (Brush CircleBrush = new SolidBrush(KVLevel == null ? Color.Red : KVLevel.Energized.ForeColor))
                g.FillEllipse(CircleBrush, DisplayRectangle);
        }
        #endregion
    }
}
